@/*
表单中input框标签中各个参数的说明:

hidden : input hidden框的id
id : input框id
name : input框名称
readonly : readonly属性
clickFun : 点击事件的方法名
style : 附加的css属性
@*/
<ul id="${id}" name="${id}">
    @for(item in list){
    <div class="row">
        <li style="position: relative" value="${item.id}">${item.customerName}&nbsp;&nbsp;${item.customerPhone}&nbsp;&nbsp;${item.phoneSharShip}
            &nbsp;&nbsp;${item.sex}&nbsp;&nbsp;${item.customerAge}&nbsp;&nbsp;${item.medicalRecordNumber}
            <span id="${item.id}"></span>
        </li>
    </div>
    <script>
        if ("${item.customerStatus}" == "老客") {
            txt = "<button type=\"button\" class=\"add${item.id} arTwo_bt\" id=\"add${item.id}\" value=\"${item.id}\">重咨</button>\n" +
                "            <button type=\"button\" class=\"reDiagnosis${item.id} arTwo_bt\" id=\"reDiagnosis${item.id}\" value=\"${item.id}\">复诊</button>\n";
            document.getElementById('${item.id}').innerHTML = txt;
            var reDiagnosis${item.id} = document.getElementsByClassName('reDiagnosis${item.id}')[0];    //加
            reDiagnosis${item.id}.onclick = function () {
                var operation = function () {
                    $.ajax({
                        url: "${ctxPath}/customer/to_reDiagnosis",
                        type: "post",
                        data: {
                            "customerId": document.getElementById('reDiagnosis${item.id}').value
                        },
                        success: function (data) {
                            console.log(data);
                            if (data == 0) {
                                alert("客户今天已到过院");
                            } else {
                                alert("复诊添加成功！");
                                window.parent.Customer.table.refresh();
                                window.parent.layer.close(parent.layer.getFrameIndex(window.name));
                            }
                        },
                        error: function (data) {
                            alert('内部故障！请联系管理员！');
                        }
                    });
                }
                Feng.confirm("是否添加复诊?", operation);
            }
            var add${item.id} = document.getElementsByClassName('add${item.id}')[0];    //加
            add${item.id}.onclick = function () {
                var index = layer.open({
                    type: 2,
                    title: '添加到店客户',
                    area: ['90%', '90%'], //宽高
                    fix: true, //不固定
                    maxmin: true,
                    content: Feng.ctxPath + '/customer/to_reconsulting/' + document.getElementById('add${item.id}').value
                });
                this.layerIndex = index;
            };
        }  else {
            txt = "<button type=\"button\" class=\"arTwo_bt add${item.id}\" id=\"add${item.id}\" value=\"${item.id}\">重咨</button>\n"
            document.getElementById('${item.id}').innerHTML = txt;
            var add${item.id} = document.getElementsByClassName('add${item.id}')[0];    //加
            add${item.id}.onclick = function () {
                var index = layer.open({
                    type: 2,
                    title: '添加到店客户',
                    area: ['90%', '90%'], //宽高
                    fix: true, //不固定
                    maxmin: true,
                    content: Feng.ctxPath + '/customer/to_reconsulting/' + document.getElementById('add${item.id}').value
                });
                this.layerIndex = index;
            };
        }

    </script>
    @}
</ul>
@if(isNotEmpty(underline) && underline == 'true'){
<div class="hr-line-dashed"></div>
<script src="${ctxPath}/static/modular/arrival/customer/customer.js"></script>
@}


